import 'package:dart_sm/dart_sm.dart';

class SM2Utils {
  static String encrypt(String data, String pubKeyHex) {
    // 加密（C1C3C2 模式，输出 Hex，保留 04 前缀）
    final cipherHex = SM2.encrypt(
      data,
      pubKeyHex,
      cipherMode: C1C3C2, // 与后端一致
    );
    return cipherHex;
  }
}
